- sort_by_menu_items = ["Field name", "Field label", "Field type", "Table name", "Display sequence", "Display block", "Display width", "Max size"].inject([]) do | items, sort_by|
  - items << %Q[{ name: "#{sort_by}", on_select: function() { #{redraw(:sort_by, sort_by.downcase!)} } }]

:plain
  new crm.Menu({
    trigger   : "#sort_by",
    fade      : 500,
    appear    : 500,
    menu_items: [ #{raw sort_by_menu_items.join(",")} ]
  });
